home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / doom / turric03.zip / TURRIC03.ZIP / PROGS / M-WIZARD.QC < prev    next >
Text File  |  1997-01-30  |  9KB  |  262 lines

  1.  
  2. /*
  3. ==============================================================================
  4.  
  5. WIZARD MORPH
  6.  
  7. ==============================================================================
  8. */
  9.  
  10. $cd /raid/quake/id1/models/a_wizard
  11. $origin 0 0 24
  12. $base wizbase    
  13. $skin wizbase
  14.  
  15. $frame hover1 hover2 hover3 hover4 hover5 hover6 hover7 hover8
  16. $frame hover9 hover10 hover11 hover12 hover13 hover14 hover15
  17.  
  18. $frame fly1 fly2 fly3 fly4 fly5 fly6 fly7 fly8 fly9 fly10
  19. $frame fly11 fly12 fly13 fly14
  20.  
  21. $frame attack1 attack2 attack3 attack4 attack5 attack6 attack7
  22. $frame attack8 attack9 attack10 attack11 attack12 attack13
  23.  
  24. $frame pain1 pain2 pain3 pain4
  25.  
  26. $frame death1 death2 death3 death4 death5 death6 death7 death8
  27.  
  28. void() player_wizard_stand = [ $hover1, player_stand1 ] {
  29.     if(self.walkframe >= 15)
  30.         self.walkframe = 0;
  31.     self.frame = $hover1 + self.walkframe;
  32.     self.walkframe = self.walkframe + 1;
  33. };
  34.  
  35. void() player_wizard_run = [ $fly1, player_run ] {
  36.     if(self.walkframe >= 14)
  37.         self.walkframe=0;
  38.     self.frame = $fly1 + self.walkframe;
  39.     self.walkframe = self.walkframe + 1;
  40. };
  41.  
  42. void() player_wizard_jump = {
  43.     self.velocity_z = 200;
  44. //** PATCH_BEGIN - morph2 - Turrican ****
  45. //    Wiz_idlesound();
  46.     sound (self, CHAN_VOICE, "wizard/wjump.wav", 1, ATTN_NORM);
  47. //** PATCH_END - morph2 - Turrican ******
  48. };
  49.  
  50. ////////////////////////////////////////////
  51. // 4 frames of pain for player_wizard, going to player_stand1
  52. ////////////////////////////////////////////
  53.  
  54. void() player_wizard_pain1 = [ $pain1, player_wizard_pain2 ]
  55. //** PATCH_BEGIN - morph2 - Turrican ****
  56. {
  57.     PainSound();
  58.     self.pain_finished = time + 0.3;
  59.     self.attack_finished = time + 0.3;
  60. //    sound (self, CHAN_VOICE, "wizard/wpain.wav", 1, ATTN_NORM);
  61. };
  62. //** PATCH_END - morph2 - Turrican ******
  63. void() player_wizard_pain2 = [ $pain2, player_wizard_pain3 ] { };
  64. void() player_wizard_pain3 = [ $pain3, player_wizard_pain4 ] { };
  65. void() player_wizard_pain4 = [ $pain4, player_stand1 ] { };
  66.  
  67. void() player_Wiz_FastFire = {
  68.     local float offset;
  69.     local entity missile;
  70.     local vector dir;
  71.  
  72.     if(random()>0.75) offset=0;
  73.     else if(random()>0.5) offset=0-(random()*10);
  74.     else offset=random()*10;
  75.  
  76.     dir=self.v_angle;
  77.     dir_y=dir_y+offset;
  78.  
  79. //    self.punchangle_x = -2;
  80.  
  81.     missile = spawn ();
  82.     missile.owner = self;
  83.     missile.movetype = MOVETYPE_FLYMISSILE;
  84.     missile.solid = SOLID_BBOX;
  85.  
  86. // set missile speed    
  87.  
  88.     missile.origin = self.origin;
  89.     makevectors (dir);
  90.     // missile.velocity = aim(self, 600);
  91.     missile.velocity = normalize(v_forward);
  92.     missile.velocity = missile.velocity * 1000;
  93.     missile.angles = vectoangles(missile.velocity);
  94.     missile.classname = "wizspike";
  95.     setmodel(missile, "progs/w_spike.mdl");
  96.     setsize(missile, '0 0 0', '0 0 0');
  97.     missile.touch = spike_touch;
  98. };
  99.  
  100. ////////////////////////////////////////////
  101. // 13 frames of attack for player_wizard, going to player_stand1
  102. ////////////////////////////////////////////
  103.  
  104. /*
  105. void() player_wizard_attack1 = [ $attack1, player_wizard_attack2 ] { self.attack_finished = time + 1.5; };
  106. void() player_wizard_attack2 = [ $attack2, player_wizard_attack3 ] { };
  107. void() player_wizard_attack3 = [ $attack3, player_wizard_attack4 ] { };
  108. void() player_wizard_attack4 = [ $attack4, player_wizard_attack5 ] { };
  109. void() player_wizard_attack5 = [ $attack5, player_wizard_attack6 ] { };
  110. void() player_wizard_attack6 = [ $attack6, player_wizard_attack7 ] { };
  111. void() player_wizard_attack7 = [ $attack7, player_wizard_attack8 ] { };
  112. void() player_wizard_attack8 = [ $attack8, player_wizard_attack9 ] { };
  113. void() player_wizard_attack9 = [ $attack9, player_wizard_attack10 ] { };
  114. void() player_wizard_attack10 = [ $attack10, player_wizard_attack11 ] { };
  115. void() player_wizard_attack11 = [ $attack11, player_wizard_attack12 ] { sound(self, CHAN_WEAPON, "wizard/wattack.wav", 1, ATTN_NORM);};
  116. void() player_wizard_attack12 = [ $attack12, player_wizard_attack13 ] {player_Wiz_FastFire(-10); };
  117. void() player_wizard_attack13 = [ $attack13, player_stand1 ] { player_Wiz_FastFire(-10);};
  118. */
  119.  
  120. void() player_wizard_attack1 = [ $attack1, player_wizard_attack3 ] { self.attack_finished = time + 1.0; };
  121. void() player_wizard_attack2 = [ $attack3, player_wizard_attack3 ] { };
  122. void() player_wizard_attack3 = [ $attack5, player_wizard_attack4 ] { };
  123. void() player_wizard_attack4 = [ $attack7, player_wizard_attack5 ] { sound(self, CHAN_WEAPON, "wizard/wattack.wav", 1, ATTN_NORM); };
  124. void() player_wizard_attack5 = [ $attack9, player_wizard_attack6 ] { player_Wiz_FastFire(); };
  125. void() player_wizard_attack6 = [ $attack11, player_wizard_attack7 ] { player_Wiz_FastFire(); };
  126. void() player_wizard_attack7 = [ $attack13, player_stand1 ] { player_Wiz_FastFire();};
  127.  
  128. string() player_wizard_killmsg = {
  129.     return " was scragged by ";
  130. };
  131.  
  132. string() player_wizard_killmsg2 = {
  133.     return ".\n";
  134. };
  135.  
  136. //** PATCH_BEGIN - morph2 - Turrican ****
  137. void()    player_wiz_death1    =[    $death1,    player_wiz_death2    ]
  138. {
  139. // Stop the scrag from flying.
  140.     if (self.flags & FL_FLY)
  141.     {
  142.         localcmd("fly");
  143.         self.flags = self.flags - FL_FLY;
  144.     }
  145. };
  146. void()    player_wiz_death2    =[    $death2,    player_wiz_death3    ] {};
  147. void()    player_wiz_death3    =[    $death3,    player_wiz_death4    ] {};
  148. void()    player_wiz_death4    =[    $death4,    player_wiz_death5    ] {};
  149. void()    player_wiz_death5    =[    $death5,    player_wiz_death6    ] {};
  150. void()    player_wiz_death6    =[    $death6,    player_wiz_death7    ] {};
  151. void()    player_wiz_death7    =[    $death7,    player_wiz_death8    ] {};
  152. void()    player_wiz_death8    =[    $death8,    player_wiz_death8    ]
  153. //** PATCH_BEGIN - gibbin3 - Turrican ****
  154. {
  155.     PlayerDead();
  156.     MakePlayerCorpse (self.max_health * self.health_modifier * 0.65,
  157.                       '-32 -32 -24', '32 32 -12');
  158. };
  159. //** PATCH_END - gibbin3 - Turrican ******
  160.  
  161. void () player_wizard_die =
  162. {
  163.     self.items = self.items - (self.items & IT_INVISIBILITY);
  164.     self.invisible_finished = 0;    // don't die as eyes
  165.     self.invincible_finished = 0;
  166.     self.super_damage_finished = 0;
  167.     self.radsuit_finished = 0;
  168.     self.view_ofs = '0 0 -8';
  169.     self.deadflag = DEAD_DYING;
  170.     self.flags = self.flags - (self.flags & FL_ONGROUND);
  171.     self.movetype = MOVETYPE_TOSS;
  172.     if (self.velocity_z < 10)
  173.         self.velocity_z = self.velocity_z + random()*300;
  174.  
  175. //** PATCH_BEGIN - gibbin3 - Turrican ****
  176. // Pass player size and head.mdl to Corpse_die using globals.
  177.     self.corpse_size = SIZE_MEDIUM;
  178.     self.head_gib_name = "progs/h_wizard.mdl";
  179. //** PATCH_END - gibbin3 - Turrican ******
  180.  
  181. // check for gib
  182.     if (self.health < -40)
  183.     {
  184. //** PATCH_BEGIN - gibbin3 - Turrican ****
  185.         Corpse_die();
  186. //** PATCH_END - gibbin3 - Turrican ******
  187.         return;
  188.     }
  189.  
  190.     DeathSound();
  191.  
  192.     self.angles_x = 0;
  193.     self.angles_z = 0;
  194.  
  195. // regular death
  196.     player_wiz_death1();
  197.  
  198. };
  199. //** PATCH_END - morph2 - Turrican ******
  200.  
  201. void() player_wizard_become = {
  202. //** PATCH_BEGIN - morph2 - Turrican ****
  203. //    bprint(self.netname);
  204. //    bprint(" has become a scrag.\n");
  205.     sprint( self, "You have become a scrag.\n");
  206.  
  207. // Make the scrag fly if it is not already.
  208.     if(!(self.flags & FL_FLY))
  209.     {
  210.         localcmd("fly");
  211.         self.flags = self.flags | FL_FLY;
  212.     }
  213.  
  214.     self._die = player_wizard_die;
  215. //** PATCH_END - morph2 - Turrican ******
  216.     self._stand=player_wizard_stand;
  217.     self._run=player_wizard_run;
  218.     self._pain=player_wizard_pain1;
  219. //** PATCH_BEGIN - morph2 - Turrican ****
  220. //    self._jump=player_wizard_jump;
  221. //    self._jump2=player_wizard_jump;
  222.     self._jump=SUB_Null;
  223.     self._jump2=SUB_Null;
  224. //** PATCH_END - morph2 - Turrican ******
  225.     self._attack=player_wizard_attack1;
  226.     self._impulse=SUB_Nop;
  227.     self._can_get_p=SUB_False;
  228.     self._killmsg=player_wizard_killmsg;
  229.     self._killmsg2=player_wizard_killmsg2;
  230.     setmodel(self,"progs/wizard.mdl");
  231.     self.modelindex_morph=self.modelindex;
  232.     self.weaponmodel = "";
  233. //** PATCH_BEGIN - morph2 - Turrican ****
  234.     self.view_ofs = '0 0 22';
  235.     if(!deathmatch)
  236.         setsize (self, VEC_HULL_MIN, VEC_HULL_MAX);
  237.     else
  238.         setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX);
  239. //** PATCH_END - morph2 - Turrican ******
  240.     self.health = self.health * 2.0 / self.health_modifier;
  241.     self.health_modifier = 2.0;
  242.     makevectors(self.v_angle);
  243.     spawn_tfog(self.origin + 20 * v_forward);
  244.     DropBackpack2();
  245. //** PATCH_BEGIN - morph2 - Turrican ****
  246.     self.currentammo = 0;
  247.     self.weapon = WIZARD_MISSILES;
  248. // Make morphs ignore player colors.
  249.     if (self.colormap != 0)
  250.     {
  251.         self.temp_colormap = self.colormap;
  252.         self.colormap = 0;
  253.     }
  254. // Make morphs ignore player skins.
  255.     if (self.skin != 0)
  256.     {
  257.         self.temp_skin = self.skin;
  258.         self.skin = 0;
  259.     }
  260. //** PATCH_END - morph2 - Turrican ******
  261. };
  262.